/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, {Component} from 'react';

import {
	StackNavigator,
} from 'react-navigation'; //导航,定义路由
import DomainStore from './stores/DomainStore'
import HomeScreen from './screens/HomeScreen'
import SecondScreen from './screens/SecondScreen'
import LoginScreen from './screens/LoginScreen'
domainStore = new DomainStore();

const Navigator = StackNavigator({
	//定义路由
	LoginScreen : {
		screen: LoginScreen
	},
	HomeScreen        : {
		screen: HomeScreen
	},
	SecondScreen: {
		screen: SecondScreen
	}
});

export default class App extends Component {
	constructor(...args) {
		super(...args);
	}

	render() {
		return (
			<Navigator
				screenProps={{
					domainStore //传递对象到子Component,这里是所有的Screen
				}}/>
		)
	}
}